<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>成功申请</title>
<?php require_once(APP.'libs'.DS.'system_properties.php');?>
<link href="<?php echo SystemProperties::$app_host_webroot;?>/css/main.css" rel="stylesheet" type="text/css" />
<link href="<?php echo SystemProperties::$app_host_webroot;?>/css/demo.css" rel="stylesheet" type="text/css" />
<?php echo header("Cache-Control:   no-cache");?>
<script type="text/javascript">

	function textCounter(field, maxlimit) { 
			field=$(field.id);
			if (field.value.length > maxlimit) {
			field.value = field.value.substring(0, maxlimit);
			return; 
			}
			
	} 
	function setSent(id,i){
		var url = "<?php echo SystemProperties::$app_host;?>"+"/user/updateInfoSent/"+<?=$change?>+'/'+id+'/'+i;
		doPost(url,'','');	
		if (i){
			document.getElementById('list_'+id).style.color = '#aaa';
			document.getElementById('list_s1_'+id).style.display = 'none';
			document.getElementById('list_s0_'+id).style.display = '';
		}else {
			document.getElementById('list_'+id).style.color = '#000';
			document.getElementById('list_s1_'+id).style.display = '';
			document.getElementById('list_s0_'+id).style.display = 'none';
		}
			
	}
</script>
</head>

<body>
<FORM id="commentsProfile" method="post" name="commentsProfile" action="<?php echo SystemProperties::$app_host;?>/user/<?=$action?>">
<table width="100%" border="0" cellspacing="1"  cellpadding="0" class="navi">
  <tr>
  <td>
  <a href="<?php echo SystemProperties::$app_host;?>/user/<?=$action?>">列出全部</a>
  或 <label class="textbox" >搜索<b>真实姓名/姓名(用户名)/ID</b>: <INPUT id="userName" name="user_name" value="" /></label><INPUT class="comment_btn_Submit" type="submit" value="查询" /></td>
   <td align="center"></td>
    
  </tr>
</table>
</form>

<br /><br />

  <?=$pager ?>
<table border="0" align="center" cellpadding="0" cellspacing="1" class="list">
  <tr>
    <td  align="center">序列号</td>
    <td  align="center">产品</td>
    <td  align="center">类型</td>
    <td  align="center">用户信息页面</td>
    <td  align="center">用户姓名</td>
    <td  align="center">用户图片</td>
	<td  align="center">性别</td>
	
	<td  align="center">年龄</td>
    <td  align="center">地区</td>
    <td  align="center">快递费</td>
    <td  align="center">联系信息</td>
	
    <td  align="center">点击时间</td>
  </tr>
  
  <?php foreach ($list as $da) { 
  	if (empty($da['g_products'])){
  		$da['g_products'] = $da['g_changes'];
  	}
  	if (empty($da['g_apply0']['remark']) && empty($da['g_exchange0']['remark'])){
  		$g_sent = 0;
  	}else {
  		$g_sent = 1;
  	}
  	$tid = empty($da['g_apply0']['g_id'])?$da['g_exchange0']['g_id']:$da['g_apply0']['g_id'];
  	
	$user_url = SystemProperties::get_profile_url($da['g_users']['g_uid']);
    //$product_link = empty($da['g_apply0']['g_id'])?(SystemProperties::$app_host."/changes/modifyChanges/0/".$da['g_products']['g_id']):(SystemProperties::$app_host."/product/modifyPruduct/0/".$da['g_products']['g_id']);
    $product_link = empty($da['g_apply0']['g_id'])?SystemProperties::get_convert_url($da['g_products']['g_id']):SystemProperties::get_product_url($da['g_products']['g_id']);
  	?>
  <tr id="list_<?=$tid?>" <?=$g_sent?'style="color:#BBB" ':''?>>
   <td  align="center"><?=$tid?><br />
    	<div id="list_s1_<?=$tid?>" <?=$g_sent?'style="display:none"':''?>>
    	<strong><span style="background-color:blue;color:white">&nbsp;&nbsp;&nbsp;未发货&nbsp;&nbsp;&nbsp;</span></strong><br /><br />
    	<a href="javascript:setSent(<?=$tid?>,1)" >设为已发</a>
    	</div>

    	<div id="list_s0_<?=$tid?>" <?=$g_sent?'':'style="display:none"'?>>
    	<strong><span style="color:#888">已发货</span></strong><br /><br />
    	<a href="javascript:setSent(<?=$tid?>,0)" >设为未发</a>
    	</div>
   
   </td>
   <td  align="center"><img src="<?php echo SystemProperties::$path.$da['g_products']['g_img']?>" width="80" height="80" /><br />
   <a href="<?=$product_link?>" target="_blank"><?php echo $da['g_products']['g_name']?></a></td>
    <td  align="center"><?=$da['g_products']['g_price']>0?"半价:<strong>{$da['g_products']['g_price']}</strong>":"免费"?></td>
    <td  align="center"><a href="<?=$user_url?>" target="_blank"><?=$da['g_users']['g_uid']?></a></td>
    <td  align="center"><a href="<?=$user_url?>" target="_blank"><?=$da['g_users']['g_name']?> (<?=$da['g_users']['g_realname']?>)</a></td>
    <td  align="center"><img width="45" src="<?=$da['g_users']['g_head']?>" /></td>
	<td  align="center"><?=empty($da['g_users']['g_realname'])?'':($da['g_users']['g_sex']==0?'女':'男')?></td>
	
	<td  align="center"><?=empty($da['g_users']['g_realname'])?'':(date('Y')-date('Y',strtotime($da['g_users']['g_birthday']))+1)?></td>
    <td  align="center"><?=$da['g_users']['g_province'].$da['g_users']['g_city']?></td>
    <td  align="center"><?=empty($da['g_users']['g_kuaidi'])?'-':($da['g_users']['g_kuaidi']=='daofu'?'到付':'淘宝')?></td>
    <td  align="center">手机：<?=$da['g_users']['g_phone']?><br />
    邮箱：<?=$da['g_users']['g_mail']?><br />
    地址：<?=$da['g_users']['g_address']?><br />
    
    </td>
    
    <td  align="center"><?=empty($da['g_apply0']['g_time'])?$da['g_exchange0']['g_time']:$da['g_apply0']['g_time']?></td>
  </tr>
  
  
  <?php } ?>
  
  
  </table>
  <?=$pager ?>
  
  </body>
  </html>